// 通用响应类型
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
}

// 分页结果类型
export interface PageResult<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
  pages: number;
}

// 分页查询参数
export interface PageQuery {
  pageNum?: number;
  pageSize?: number;
}

// 用户相关类型
export interface User {
  userId: number;
  username: string;
  role?: 'ADMIN' | 'USER';
  permissions?: string[];
  name: string;
  email?: string;
  phone?: string;
  createTime?: string;
  updateTime?: string;
}

export interface LoginRequest {
  username: string;
  password: string;
}

export interface LoginResponse {
  token: string;
  user: User;
}

export interface UserQuery extends PageQuery {
  username?: string;
  role?: string;
  name?: string;
}

// 权限相关类型
export interface Permission {
  permissionId: number;
  permissionName: string;
}

// 角色相关类型
export interface Role {
  roleId: number;
  roleName: string;
  description: string;
}

// 服务项目相关类型
export interface Services {
  serviceId: number;
  serviceName: string;
  serviceDescription: string;
  durationMinutes: number;
  servicePrice: number;
  applicablePetType: string; // 大驼峰命名
}
export interface ServicesQuery extends PageQuery {
  serviceName?: string;
  serviceDescription?: string;
  durationMinutes?: number;
  servicePrice?: number;
  applicablePetType?: string;
}

// 服务人员相关类型
export interface Staffs {
  staffId?: number;
  staffName: string;
  role: string;
}

export interface StaffsQuery extends PageQuery {
  staffName?: string;
  role?: string;
}

// 客户档案相关类型
export interface Users {
  userId?: number;
  username?: string;
  phone?: string;
  tel?: string;
  email?: string;
  address?: string;
  hobby?: string;
  userNotes?: string;
}

export interface UsersQuery extends PageQuery {
  userName?: string;
  role?: string;
  phone?: string;
  email?: string;
}

// 宠物档案相关类型
export interface Pets {
  petId?: number;
  userId?: number;
  petName?: string;
  petBreed?: string;
  petType?: string;
  petGender?: string;
  petBirth?: string;
  petColor?: string;
  petWeight?: number;
  petNeuter?: boolean;
  petNotes?: string;
  source?: string;
}

export interface PetsQuery extends PageQuery {
  petName?: string;
  role?: string;
}

// 预约记录相关类型
export interface Appointments {
  appointmentId?: number;
  userId?: number;
  petId?: number;
  serviceId?: number;
  staffId?: number;
  resourceId?: number;
  startTime?: string;
  endTime?: string;
  appointmentStatus?: string;
}

export interface AppointmentsQuery extends PageQuery {
  userId?: number;
  petId?: number;
  serviceId?: number;
  staffId?: number;
  resourceId?: number;
  startTime?: string;
  endTime?: string;
  appointmentStatus?: string;
}

// 体检记录相关类型
export interface Checkups {
  checkupId?: number;
  petId?: number;
  checkupDate?: string;
  weight?: number;
  temperature?: number;
  testsperformed?: string;
  checkupsResults?: string;
}

export interface CheckupsQuery extends PageQuery {
  checkupId?: number;
  petId?: number;
  checkupDate?: string;
  checkupDateStart?: string;
  checkupDateEnd?: string;
  weight?: number;
  temperature?: number;
  testsperformed?: string;
  checkupsResults?: string;
}

// 医疗记录相关类型
export interface Medical {
  medicalId?: number;
  petId?: number;
  staffId?: number;
  diagnosisDate?: string;
  medicalName?: string;
  symptoms?: string;
  medicalResult?: string;
  treatmentPlan?: string;
  medication?: string;
  cost?: number;
  status?: string;
  followupDate?: string;
}

export interface MedicalQuery extends PageQuery {
  medicalId?: number;
  petId?: number;
  petName?: string;
  diagnosisDate?: string;
  diagnosisDateStart?: string;
  diagnosisDateEnd?: string;
  medicalName?: string;
  symptoms?: string;
  medicalResult?: string;
  treatmentPlan?: string;
  medication?: string;
  followupDate?: string;
}

// 疫苗记录相关类型
export interface Vaccine {
  vaccineId?: number;
  petId?: number;
  vaccineType?: string;
  vaccineBrand?: string;
  vaccineDate?: string;
  expiryDate?: string;
  reminderDate?: string;
  vaccineAdministered?: string;
}

export interface VaccineQuery extends PageQuery {
  vaccineId?: number;
  petId?: number;
  vaccineType?: string;
  vaccineBrand?: string;
  vaccineDate?: string;
  vaccineDateStart?: string;
  vaccineDateEnd?: string;
  expiryDate?: string;
  reminderDate?: string;
  vaccineAdministered?: string;
}

// 驱虫记录相关类型
export interface Dewormings {
  dewormingId?: number;
  petId?: number;
  dewormerType?: string;
  dewormingsBrand?: string;
  dewormingsDate?: string;
  nextdueDate?: string;
  dewormingsAdministered?: string;
}

export interface DewormingQuery extends PageQuery {
  dewormingId?: number;
  petId?: number;
  dewormerType?: string;
  dewormingsBrand?: string;
  dewormingsDate?: string;
  dewormingsDateStart?: string;
  dewormingsDateEnd?: string;
  nextdueDate?: string;
  dewormingsAdministered?: string;
}

// 服务资源相关类型
export interface Resources {
  resourceId?: number;
  resourceName?: string;
  resourceType?: string;
}

export interface ResourcesQuery extends PageQuery {
  resourceName?: string;
  resourceType?: string;
  status?: string;
  priceMin?: number;
  priceMax?: number;
}

// 服务执行记录相关类型
export interface ServiceRecords {
  recordId?: number;
  appointmentId?: number;
  staffId?: number;
  startTime?: string;
  endTime?: string;
  itemsUsed?: string;
  serviceDetails?: string;
  costDetails?: string;
}

export interface ServiceRecordsQuery extends PageQuery {
  recordId?: number;
  appointmentId?: number;
  serviceId?: number;
  staffId?: number;
  startTime?: string;
  endTime?: string;
  serviceNotes?: string;
} 